* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #1e3c72, #2a5298, #1e3c72);
    color: white;
    overflow-x: hidden;
    min-height: 100vh;
    user-select: none;
}

.container {
    max-width: 100%;
    padding: 20px;
    margin: 0 auto;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.connection-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.2rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff4757;
    box-shadow: 0 0 10px #ff4757;
    animation: pulse 2s infinite;
}

.status-indicator.connected {
    background: #2ed573;
    box-shadow: 0 0 10px #2ed573;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

/* 控制面板 */
.control-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.connection-panel {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.input-group input {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.connect-btn, .disconnect-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.connect-btn {
    background: linear-gradient(45deg, #2ed573, #17a2b8);
    color: white;
}

.connect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 213, 115, 0.4);
}

.disconnect-btn {
    background: linear-gradient(45deg, #ff4757, #ff6b7a);
    color: white;
}

.disconnect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.4);
}

.disconnect-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 速度显示 */
.speed-display {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.speed-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
}

.speed-label {
    font-weight: bold;
    min-width: 80px;
}

.speed-value {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    color: #2ed573;
    text-shadow: 0 0 5px rgba(46, 213, 115, 0.5);
}

.speed-unit {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

/* 摇杆区域 */
.joystick-area {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 50px;
    margin: 50px 0;
    padding: 40px 0;
}

.joystick-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.joystick-label {
    font-size: 1.3rem;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    margin-bottom: 10px;
}

.joystick {
    position: relative;
}

.joystick-base {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.4));
    border: 3px solid rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(255, 255, 255, 0.1);
}

.joystick-handle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff, #ccc);
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    position: absolute;
    transition: all 0.1s ease-out;
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.3),
        inset 0 2px 5px rgba(255, 255, 255, 0.5);
}

.joystick-handle:hover {
    transform: scale(1.1);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.4),
        inset 0 2px 5px rgba(255, 255, 255, 0.7);
}

.joystick-handle.active {
    background: radial-gradient(circle at 30% 30%, #2ed573, #17a2b8);
    box-shadow: 
        0 8px 20px rgba(46, 213, 115, 0.4),
        inset 0 2px 5px rgba(255, 255, 255, 0.7);
}

.joystick-info {
    text-align: center;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.coord-display {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.coord-display span {
    font-family: 'Courier New', monospace;
    color: #2ed573;
}

/* 控制按钮区域 */
.button-area {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.control-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.emergency-stop {
    background: radial-gradient(circle at 30% 30%, #ff4757, #c44569);
}

.emergency-stop:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 25px rgba(255, 71, 87, 0.4);
}

.speed-boost {
    background: radial-gradient(circle at 30% 30%, #ffa502, #ff6348);
}

.speed-boost:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 25px rgba(255, 165, 2, 0.4);
}

.speed-boost.active {
    background: radial-gradient(circle at 30% 30%, #2ed573, #17a2b8);
    animation: glow 1s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 0 20px rgba(46, 213, 115, 0.5); }
    to { box-shadow: 0 0 30px rgba(46, 213, 115, 0.8); }
}

.reset-position {
    background: radial-gradient(circle at 30% 30%, #3742fa, #2f3542);
}

.reset-position:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 25px rgba(55, 66, 250, 0.4);
}

.btn-icon {
    font-size: 2rem;
    margin-bottom: 5px;
}

.btn-text {
    font-size: 0.9rem;
}

/* 日志区域 */
.log-area {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    margin-top: 30px;
}

.log-header {
    background: rgba(0, 0, 0, 0.5);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.clear-log-btn {
    background: rgba(255, 71, 87, 0.8);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.clear-log-btn:hover {
    background: rgba(255, 71, 87, 1);
    transform: translateY(-2px);
}

.log-content {
    max-height: 200px;
    overflow-y: auto;
    padding: 15px 20px;
}

.log-entry {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry.success {
    color: #2ed573;
}

.log-entry.error {
    color: #ff4757;
}

.log-entry.warning {
    color: #ffa502;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .control-panel {
        grid-template-columns: 1fr;
    }
    
    .joystick-area {
        flex-direction: column;
        gap: 30px;
    }
    
    .joystick-base {
        width: 120px;
        height: 120px;
    }
    
    .joystick-handle {
        width: 50px;
        height: 50px;
    }
    
    .button-area {
        gap: 20px;
    }
    
    .control-btn {
        width: 80px;
        height: 80px;
        font-size: 0.9rem;
    }
    
    .btn-icon {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .joystick-area {
        padding: 20px 0;
    }
    
    .joystick-base {
        width: 100px;
        height: 100px;
    }
    
    .joystick-handle {
        width: 40px;
        height: 40px;
    }
    
    .control-btn {
        width: 70px;
        height: 70px;
    }
    
    .btn-icon {
        font-size: 1.2rem;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
} 